package com.anyisn.anyflickr.shell.controller.tile
{
	import com.anyisn.anyflickr.shell.model.ListPhotosProxy;
	import com.anyisn.anyflickr.shell.model.SettingsProxy;
	import com.anyisn.anyflickr.shell.model.vo.SearchVO;
	
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;

	public class TilePhotosSearchCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void {
			var photosP:ListPhotosProxy = facade.retrieveProxy(ListPhotosProxy.NAME) as ListPhotosProxy;
			var arr:Array = notification.getBody() as Array;
			var vo:SearchVO = arr[0] as SearchVO;
			var settingsP:SettingsProxy = facade.retrieveProxy(SettingsProxy.NAME) as SettingsProxy;
			settingsP.tilePerpage = arr[1];
			photosP.search(vo);
		}
	}
}